package com.order.promotion.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.order.promotion.mapper.OrderPromotionMapper;
import com.order.promotion.domain.OrderPromotion;
import com.order.promotion.service.IOrderPromotionService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 食品宣传Service业务层处理
 * 
 * @author huhu
 * @date 2020-08-29
 */
@Service
public class OrderPromotionServiceImpl implements IOrderPromotionService 
{
    @Autowired
    private OrderPromotionMapper orderPromotionMapper;

    /**
     * 查询食品宣传
     * 
     * @param promotionId 食品宣传ID
     * @return 食品宣传
     */
    @Override
    public OrderPromotion selectOrderPromotionById(Long promotionId)
    {
        return orderPromotionMapper.selectOrderPromotionById(promotionId);
    }

    /**
     * 查询食品宣传列表
     * 
     * @param orderPromotion 食品宣传
     * @return 食品宣传
     */
    @Override
    public List<OrderPromotion> selectOrderPromotionList(OrderPromotion orderPromotion)
    {
        return orderPromotionMapper.selectOrderPromotionList(orderPromotion);
    }

    /**
     * 新增食品宣传
     * 
     * @param orderPromotion 食品宣传
     * @return 结果
     */
    @Override
    public int insertOrderPromotion(OrderPromotion orderPromotion)
    {
        return orderPromotionMapper.insertOrderPromotion(orderPromotion);
    }

    /**
     * 修改食品宣传
     * 
     * @param orderPromotion 食品宣传
     * @return 结果
     */
    @Override
    public int updateOrderPromotion(OrderPromotion orderPromotion)
    {
        return orderPromotionMapper.updateOrderPromotion(orderPromotion);
    }

    /**
     * 删除食品宣传对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteOrderPromotionByIds(String ids)
    {
        return orderPromotionMapper.deleteOrderPromotionByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除食品宣传信息
     * 
     * @param promotionId 食品宣传ID
     * @return 结果
     */
    @Override
    public int deleteOrderPromotionById(Long promotionId)
    {
        return orderPromotionMapper.deleteOrderPromotionById(promotionId);
    }

    @Override
    public List<OrderPromotion> selectPromotionId() {
        return orderPromotionMapper.selectPromotionId();
    }
}
